/*
 * This file is part of FinVis.
 *
 * FinVis is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * FinVis is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.

 * You should have received a copy of the GNU General Public License
 * along with FinVis.  If not, see <http://www.gnu.org/licenses/>
 *
 * @author Stephen Rudolph
 */

#ifndef FIN_INVESTMENT_H
#define FIN_INVESTMENT_H

#include <QDate>

/**
 * This class represents a single financial investment
 */
class FinInvestment {
public:
    FinInvestment();
    FinInvestment(QString title, int principal, QDate startDate,
                  int investmentOptionVectorIndex);
    FinInvestment(const FinInvestment& investment);
    ~FinInvestment();

    bool operator<(const FinInvestment &b) const
    {
        return m_startDate.year() < b.m_startDate.year();
    }

    void assign(FinInvestment investment);

    bool isSimpleInterest();

    QDate startDate();
    void setStartDate(QDate startDate);

    QString title();
    void setTitle(QString title);

    int durationYears();

    int principal();
    void setPrincipal(int principal);

    double expectedAnnualGrowth();
    double standardDeviation();

    void setInvestmentOptionVectorIndex(int investmentOptionVectorIndex);
    int investmentOptionVectorIndex();

    void setOrderIndex(int orderIndex);
    int orderIndex();
private:
    QString m_title;
    int m_principal;
    QDate m_startDate;
    int m_investmentOptionVectorIndex;
    int m_orderIndex;
};

#endif
